package com.jinhao.crowd.boot.handler;

import com.jinhao.crowd.boot.entity.User;
import com.jinhao.crowd.boot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created on 2021/10/4.
 *
 * @author Valar Morghulis
 */
@RestController
public class HelloHandler {

    @Autowired
    private UserService userService;

    @RequestMapping("/get/hello/word/message")
    public String getHello(){
        return "SpringBoot================HelloWord!!!";
    }


    @RequestMapping("/get/all/users")
    public List<User> getAll(){

        return userService.getAll();
    }
}
